package com.idroid.database;

import com.idroid.domain.AreaType;
import com.idroid.domain.PaymentMethodType;

import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class ParkingFlexDbHelper extends SQLiteOpenHelper {

	static final String DBNAME = "ParkingFlex";

	// CITY TABLE

	static final String CITY_TABLE = "City";
	static final String CITY_ID = "city_id";
	static final String CITY_NAME = "city_name";
	static final String CITY_STATE = "city_state";

	static final String CREATE_CITY_TABLE = "CREATE TABLE " + CITY_TABLE + " ("
			+ CITY_ID + " INTEGER PRIMARY KEY, " + CITY_NAME
			+ " TEXT NOT NULL, " + CITY_STATE + " TEXT NOT NULL);";

	// CITY_ZIPCODE TABLE

	static final String CITY_ZIPCODE_TABLE = "City_Zipcode";
	static final String ZIPCODE_ID = "zipcode_id";
	static final String ZIPCODE = "zipcode";
	// foreign key static final String CITY_ID = "city_id";

	static final String CREATE_CITY_ZIPCODE_TABLE = "CREATE TABLE "
			+ CITY_ZIPCODE_TABLE + " (" + ZIPCODE_ID + " INTEGER PRIMARY KEY, "
			+ ZIPCODE + " TEXT NOT NULL, " + CITY_ID
			+ " INTEGER NOT NULL, FOREIGN KEY (" + CITY_ID + ") REFERENCES "
			+ CITY_TABLE + " (" + CITY_ID + "));";

	// PARKING_AREA TABLE

	static final String PARKING_AREA_TABLE = "Parking_Area";
	static final String AREA_ID = "area_id";
	static final String AREA_NAME = "area_name";
	static final String ADDRESS_LINE = "address_line";
	static final String CAPACITY = "capacity";
	static final String AMOUNT = "amount";
	static final String AREA_TYPE = "area_type";
	static final String PAYMENT_METHOD = "payment_method";
	static final String PHONE_NUMBER = "phone_number";
	static final String LATITUDE = "latitude";
	static final String LONGITUDE = "longitude";
	static final String HAS_POSITION = "has_position";

	// foreign key static final String ZIPCODE_ID = "zipcode_id";

	static final String CREATE_PARKING_AREA_TABLE = "CREATE TABLE "
			+ PARKING_AREA_TABLE + " (" + AREA_ID + " INTEGER PRIMARY KEY, "
			+ AREA_NAME + " TEXT NOT NULL, " + ADDRESS_LINE
			+ " TEXT NOT NULL, " + CAPACITY + " INTEGER NOT NULL, " + AMOUNT
			+ " REAL NOT NULL, " + PHONE_NUMBER + " TEXT NOT NULL, "+ HAS_POSITION + " boolean, "
			+ AREA_TYPE + " TEXT NOT NULL, " + PAYMENT_METHOD
			+ " TEXT NOT NULL, " + LATITUDE + " REAL, " + LONGITUDE + " REAL, "
			+ ZIPCODE_ID + " INTEGER NOT NULL, FOREIGN KEY (" + ZIPCODE_ID
			+ ") REFERENCES " + CITY_ZIPCODE_TABLE + " (" + ZIPCODE_ID + "));";

	// AVAILABILITY TABLE

	static final String AVAILABILITY_TABLE = "Availability";
	static final String AVAILABILITY_ID = "availability_id";
	static final String AVAILABLE_SPOTS = "available_spots";
	static final String LAST_UPDATE = "last_update";
	// foreign key static final String AREA_ID = "ramp_id";

	static final String CREATE_AVAILABILITY_TABLE = "CREATE TABLE "
			+ AVAILABILITY_TABLE + " (" + AVAILABILITY_ID
			+ " INTEGER PRIMARY KEY, " + AVAILABLE_SPOTS
			+ " INTEGER NOT NULL, " + LAST_UPDATE + " TEXT, " + AREA_ID
			+ " INTEGER NOT NULL, FOREIGN KEY (" + AREA_ID + ") REFERENCES "
			+ PARKING_AREA_TABLE + " (" + AREA_ID + "));";

	public ParkingFlexDbHelper(Context context) {
		super(context, DBNAME, null, 1);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {

		db.execSQL(CREATE_CITY_TABLE);
		db.execSQL(CREATE_CITY_ZIPCODE_TABLE);
		db.execSQL(CREATE_PARKING_AREA_TABLE);
		db.execSQL(CREATE_AVAILABILITY_TABLE);

		populateDb(db);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL("DROP TABLE IF EXISTS " + CREATE_CITY_TABLE);
		db.execSQL("DROP TABLE IF EXISTS " + CREATE_CITY_ZIPCODE_TABLE);
		db.execSQL("DROP TABLE IF EXISTS " + CREATE_PARKING_AREA_TABLE);
		db.execSQL("DROP TABLE IF EXISTS " + CREATE_AVAILABILITY_TABLE);
	}

	private void populateDb(SQLiteDatabase db) {
		// This method would not be necessary if this application were a
		// production application.
		// We are only simulating a true production application here.
		ContentValues cv;
		// Populate Cities
		cv = new ContentValues();
		cv.put(CITY_ID, 1);
		cv.put(CITY_NAME, "Minneapolis");
		cv.put(CITY_STATE, "Minnesota");
		db.insert(CITY_TABLE, CITY_ID, cv);

		cv = new ContentValues();
		 cv.put(CITY_ID, 2);
		 cv.put(CITY_NAME, "St Paul");
		 cv.put(CITY_STATE, "Minnesota");
		 db.insert(CITY_TABLE, CITY_ID, cv);

		// Populate Zipcodes
		 cv = new ContentValues();
		cv.put(ZIPCODE_ID, 55042);
		cv.put(ZIPCODE, "55042");
		cv.put(CITY_ID, 1);
		db.insert(CITY_ZIPCODE_TABLE, ZIPCODE_ID, cv);

		cv = new ContentValues();
		cv.put(ZIPCODE_ID, 55043);
		cv.put(ZIPCODE, "55043");
		cv.put(CITY_ID, 1);
		db.insert(CITY_ZIPCODE_TABLE, ZIPCODE_ID, cv);

		cv = new ContentValues();
		cv.put(ZIPCODE_ID, 55401);
		cv.put(ZIPCODE, "55401");
		cv.put(CITY_ID, 1);
		db.insert(CITY_ZIPCODE_TABLE, ZIPCODE_ID, cv);

		cv = new ContentValues();
		cv.put(ZIPCODE_ID, 55402);
		cv.put(ZIPCODE, "55402");
		cv.put(CITY_ID, 1);
		db.insert(CITY_ZIPCODE_TABLE, ZIPCODE_ID, cv);

		cv = new ContentValues();
		cv.put(ZIPCODE_ID, 55403);
		cv.put(ZIPCODE, "55403");
		cv.put(CITY_ID, 1);
		db.insert(CITY_ZIPCODE_TABLE, ZIPCODE_ID, cv);

		cv = new ContentValues();
		cv.put(ZIPCODE_ID, 55415);
		cv.put(ZIPCODE, "55415");
		cv.put(CITY_ID, 1);
		db.insert(CITY_ZIPCODE_TABLE, ZIPCODE_ID, cv);

		cv = new ContentValues();
		cv.put(ZIPCODE_ID, 55455);
		cv.put(ZIPCODE, "55455");
		cv.put(CITY_ID, 1);
		db.insert(CITY_ZIPCODE_TABLE, ZIPCODE_ID, cv);

		cv = new ContentValues();
		cv.put(ZIPCODE_ID, 55487);
		cv.put(ZIPCODE, "55487");
		cv.put(CITY_ID, 1);
		db.insert(CITY_ZIPCODE_TABLE, ZIPCODE_ID, cv);
		
		cv = new ContentValues();
		cv.put(ZIPCODE_ID, 55102);
		cv.put(ZIPCODE, "55102");
		cv.put(CITY_ID, 2);
		db.insert(CITY_ZIPCODE_TABLE, ZIPCODE_ID, cv);
		
		cv = new ContentValues();
		cv.put(ZIPCODE_ID, 55101);
		cv.put(ZIPCODE, "55101");
		cv.put(CITY_ID, 2);
		db.insert(CITY_ZIPCODE_TABLE, ZIPCODE_ID, cv);
		
		cv = new ContentValues();
		cv.put(ZIPCODE_ID, 55107);
		cv.put(ZIPCODE, "55107");
		cv.put(CITY_ID, 2);
		db.insert(CITY_ZIPCODE_TABLE, ZIPCODE_ID, cv);


		// Populate Ramps

		cv = new ContentValues();
		cv.put(AREA_ID, 1);
		cv.put(AREA_NAME, "11th & Harmon");
		cv.put(ADDRESS_LINE, "25 11th St S");
		cv.put(CAPACITY, 600);
		cv.put(AMOUNT, 6.00);
		cv.put(ZIPCODE_ID, 55403);
		cv.put(AREA_TYPE, AreaType.SmallRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 343-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 1);
		cv.put(AVAILABLE_SPOTS, 100);
		cv.put(AREA_ID, 1);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 2);
		cv.put(AREA_NAME, "11th & Marquette");
		cv.put(ADDRESS_LINE, "1111 Marquette Avenue");
		cv.put(CAPACITY, 1100);
		cv.put(AMOUNT, 3.00);
		cv.put(ZIPCODE_ID, 55403);
		cv.put(AREA_TYPE, AreaType.LargeRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 673-9650");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 2);
		cv.put(AVAILABLE_SPOTS, 300);

		cv.put(AREA_ID, 2);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 3);
		cv.put(AREA_NAME, "A Ramp");
		cv.put(ADDRESS_LINE, "101 North 9th Street");
		cv.put(CAPACITY, 3631);
		cv.put(AMOUNT, 3.00);
		cv.put(ZIPCODE_ID, 55403);
		cv.put(AREA_TYPE, AreaType.LargeRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 343-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 3);
		cv.put(AVAILABLE_SPOTS, 600);

		cv.put(AREA_ID, 3);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 4);
		cv.put(AREA_NAME, "B Ramp");
		cv.put(ADDRESS_LINE, "516 2nd Avenue North");
		cv.put(CAPACITY, 1606);
		cv.put(AMOUNT, 3.00);
		cv.put(ZIPCODE_ID, 55403);
		cv.put(AREA_TYPE, AreaType.MediumRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 343-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 4);
		cv.put(AVAILABLE_SPOTS, 600);

		cv.put(AREA_ID, 4);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 5);
		cv.put(AREA_NAME, "C Ramp");
		cv.put(ADDRESS_LINE, "318 2nd Avenue North");
		cv.put(CAPACITY, 1518);
		cv.put(AMOUNT, 3.00);
		cv.put(ZIPCODE_ID, 55401);
		cv.put(AREA_TYPE, AreaType.MediumRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 343-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 5);
		cv.put(AVAILABLE_SPOTS, 400);

		cv.put(AREA_ID, 5);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 6);
		cv.put(AREA_NAME, "Courthouse");
		cv.put(ADDRESS_LINE, "300 South 4th Street");
		cv.put(CAPACITY, 1518);
		cv.put(AMOUNT, 3.00);
		cv.put(ZIPCODE_ID, 55415);
		cv.put(AREA_TYPE, AreaType.SmallRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 343-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 6);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 6);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 7);
		cv.put(AREA_NAME, "Government Ctr.");
		cv.put(ADDRESS_LINE, "415 South 5th Street");
		cv.put(CAPACITY, 1303);
		cv.put(AMOUNT, 3.00);
		cv.put(ZIPCODE_ID, 55487);
		cv.put(AREA_TYPE, AreaType.MediumRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 343-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 7);
		cv.put(AVAILABLE_SPOTS, 100);

		cv.put(AREA_ID, 7);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 8);
		cv.put(AREA_NAME, "Hawthorne Trans. Ctr.");
		cv.put(ADDRESS_LINE, "31 North 9th Street");
		cv.put(CAPACITY, 975);
		cv.put(AMOUNT, 3.00);
		cv.put(ZIPCODE_ID, 55415);
		cv.put(AREA_TYPE, AreaType.MediumRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 333-9031");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 8);
		cv.put(AVAILABLE_SPOTS, 100);

		cv.put(AREA_ID, 8);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 9);
		cv.put(AREA_NAME, "Hennepin at 10th");
		cv.put(ADDRESS_LINE, "935 Hennepin Ave.");
		cv.put(CAPACITY, 643);
		cv.put(AMOUNT, 3.00);
		cv.put(ZIPCODE_ID, 55402);
		cv.put(AREA_TYPE, AreaType.Underground.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 343-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 9);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 9);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 10);
		cv.put(AREA_NAME, "11th Street Ramp");
		cv.put(ADDRESS_LINE, "1030 2nd Avenue South");
		cv.put(CAPACITY, 1200);
		cv.put(AMOUNT, 3.00);
		cv.put(ZIPCODE_ID, 55402);
		cv.put(AREA_TYPE, AreaType.Underground.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 343-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 10);
		cv.put(AVAILABLE_SPOTS, 150);

		cv.put(AREA_ID, 10);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 11);
		cv.put(AREA_NAME, "Jerry Haaf Memorial");
		cv.put(ADDRESS_LINE, "424 S 4th St");
		cv.put(CAPACITY, 791);
		cv.put(AMOUNT, 3.00);
		cv.put(ZIPCODE_ID, 55415);
		cv.put(AREA_TYPE, AreaType.MediumRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 343-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 11);
		cv.put(AVAILABLE_SPOTS, 100);

		cv.put(AREA_ID, 11);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 12);
		cv.put(AREA_NAME, "LaSalle at 10th");
		cv.put(ADDRESS_LINE, "915 LaSalle Avenue");
		cv.put(CAPACITY, 830);
		cv.put(AMOUNT, 4.00);
		cv.put(ZIPCODE_ID, 55042);
		cv.put(AREA_TYPE, AreaType.MediumRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 343-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 12);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 12);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 13);
		cv.put(AREA_NAME, "Leamington Ramp");
		cv.put(ADDRESS_LINE, "1001 2nd Avenue South");
		cv.put(CAPACITY, 2020);
		cv.put(AMOUNT, 3.00);
		cv.put(ZIPCODE_ID, 55042);
		cv.put(AREA_TYPE, AreaType.LargeRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 673-9650");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 13);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 13);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 14);
		cv.put(AREA_NAME, "Mill Quarter Ramp");
		cv.put(ADDRESS_LINE, "711 S. 2nd Street");
		cv.put(CAPACITY, 324);
		cv.put(AMOUNT, 2.00);
		cv.put(ZIPCODE_ID, 55415);
		cv.put(AREA_TYPE, AreaType.SmallRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 343-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 14);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 14);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 15);
		cv.put(AREA_NAME, "Plaza Ramp");
		cv.put(ADDRESS_LINE, "117 S 12th St");
		cv.put(CAPACITY, 1518);
		cv.put(AMOUNT, 4.00);
		cv.put(ZIPCODE_ID, 55403);
		cv.put(AREA_TYPE, AreaType.MediumRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 343-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 15);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 15);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 16);
		cv.put(AREA_NAME, "Riverfront Municipal");
		cv.put(ADDRESS_LINE, "212 9th Ave S");
		cv.put(CAPACITY, 997);
		cv.put(AMOUNT, 2.00);
		cv.put(ZIPCODE_ID, 55415);
		cv.put(AREA_TYPE, AreaType.SmallRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 343-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 16);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 16);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 17);
		cv.put(AREA_NAME, "Vineland Place Ramp");
		cv.put(ADDRESS_LINE, "727 Vineland Place");
		cv.put(CAPACITY, 675);
		cv.put(AMOUNT, 3.00);
		cv.put(ZIPCODE_ID, 55403);
		cv.put(AREA_TYPE, AreaType.SmallRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 343-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 17);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 17);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 18);
		cv.put(AREA_NAME, "Weisman Art Museum");
		cv.put(ADDRESS_LINE, "333 East River Road");
		cv.put(CAPACITY, 124);
		cv.put(AMOUNT, 3.00);
		cv.put(ZIPCODE_ID, 55455);
		cv.put(AREA_TYPE, AreaType.Underground.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 626-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 18);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 18);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 19);
		cv.put(AREA_NAME, "Church Street");
		cv.put(ADDRESS_LINE, "80 Church St SEt");
		cv.put(CAPACITY, 234);
		cv.put(AMOUNT, 3.00);
		cv.put(ZIPCODE_ID, 55455);
		cv.put(AREA_TYPE, AreaType.Underground.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 626-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 19);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 19);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 20);
		cv.put(AREA_NAME, "East River Road");
		cv.put(ADDRESS_LINE, "385 East River Road");
		cv.put(CAPACITY, 1914);
		cv.put(AMOUNT, 3.00);
		cv.put(ZIPCODE_ID, 55455);
		cv.put(AREA_TYPE, AreaType.LargeRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 626-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 20);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 20);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 21);
		cv.put(AREA_NAME, "Nolte Center");
		cv.put(ADDRESS_LINE, "14 Church St. SE");
		cv.put(CAPACITY, 119);
		cv.put(AMOUNT, 3.00);
		cv.put(ZIPCODE_ID, 55455);
		cv.put(AREA_TYPE, AreaType.Underground.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 626-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 21);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 21);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 22);
		cv.put(AREA_NAME, "4th Street Ramp");
		cv.put(ADDRESS_LINE, "1625 4TH ST SE");
		cv.put(CAPACITY, 1200);
		cv.put(AMOUNT, 3.00);
		cv.put(ZIPCODE_ID, 55455);
		cv.put(AREA_TYPE, AreaType.LargeRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 626-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 22);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 22);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 23);
		cv.put(AREA_NAME, "Oak Street Ramp");
		cv.put(ADDRESS_LINE, "401 Oak St SE");
		cv.put(CAPACITY, 2187);
		cv.put(AMOUNT, 3.00);
		cv.put(ZIPCODE_ID, 55455);
		cv.put(AREA_TYPE, AreaType.LargeRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 626-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 23);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 23);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 24);
		cv.put(AREA_NAME, "University Ave. Ramp");
		cv.put(ADDRESS_LINE, "1926 University Ave SE");
		cv.put(CAPACITY, 521);
		cv.put(AMOUNT, 3.00);
		cv.put(ZIPCODE_ID, 55415);
		cv.put(AREA_TYPE, AreaType.LargeRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 626-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 24);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 24);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 25);
		cv.put(AREA_NAME, "Washington Ave. Ramp");
		cv.put(ADDRESS_LINE, "501 Washington Ave SE");
		cv.put(CAPACITY, 1293);
		cv.put(AMOUNT, 3.00);
		cv.put(ZIPCODE_ID, 55455);
		cv.put(AREA_TYPE, AreaType.LargeRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 626-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 25);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 25);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 26);
		cv.put(AREA_NAME, "Gopher Lot");
		cv.put(ADDRESS_LINE, "310 23rd Ave SE");
		cv.put(CAPACITY, 100);
		cv.put(AMOUNT, 3.00);
		cv.put(ZIPCODE_ID, 55455);
		cv.put(AREA_TYPE, AreaType.Lot.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 626-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 26);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 26);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 27);
		cv.put(AREA_NAME, "Maroon Lot");
		cv.put(ADDRESS_LINE, "2010 6th St SE");
		cv.put(CAPACITY, 408);
		cv.put(AMOUNT, 3.00);
		cv.put(ZIPCODE_ID, 55455);
		cv.put(AREA_TYPE, AreaType.Lot.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.Cash.toString());
		cv.put(PHONE_NUMBER, "(612) 626-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 27);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 27);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 28);
		cv.put(AREA_NAME, "Victory Lot");
		cv.put(ADDRESS_LINE, "2302 6th St SE");
		cv.put(CAPACITY, 234);
		cv.put(AMOUNT, .5);
		cv.put(ZIPCODE_ID, 55455);
		cv.put(AREA_TYPE, AreaType.SmallRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.Cash.toString());
		cv.put(PHONE_NUMBER, "(612) 626-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 28);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 28);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		cv = new ContentValues();
		cv.put(AREA_ID, 29);
		cv.put(AREA_NAME, "Lot 37");
		cv.put(ADDRESS_LINE, "1811 5th St SE");
		cv.put(CAPACITY, 656);
		cv.put(AMOUNT, .5);
		cv.put(ZIPCODE_ID, 55455);
		cv.put(AREA_TYPE, AreaType.SmallRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 626-7275");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 29);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 29);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);
		
		cv = new ContentValues();
		cv.put(AREA_ID, 30);
		cv.put(AREA_NAME, "Holiday Inn Ramp");
		cv.put(ADDRESS_LINE, "234 Kellogg Blvd");
		cv.put(CAPACITY, 500);
		cv.put(AMOUNT, 2);
		cv.put(ZIPCODE_ID, 55102);
		cv.put(AREA_TYPE, AreaType.SmallRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 375-1301");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 30);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 30);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);

		
		cv = new ContentValues();
		cv.put(AREA_ID, 31);
		cv.put(AREA_NAME, "Wax Lot");
		cv.put(ADDRESS_LINE, "177 Exchange St");
		cv.put(CAPACITY, 500);
		cv.put(AMOUNT, 5);
		cv.put(ZIPCODE_ID, 55102);
		cv.put(AREA_TYPE, AreaType.SmallRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 375-1301");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 31);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 31);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);
		
		cv = new ContentValues();
		cv.put(AREA_ID, 32);
		cv.put(AREA_NAME, "Ryan Lot");
		cv.put(ADDRESS_LINE, "217 Chestnut St");
		cv.put(CAPACITY, 500);
		cv.put(AMOUNT, 5);
		cv.put(ZIPCODE_ID, 55102);
		cv.put(AREA_TYPE, AreaType.SmallRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 375-8000");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 32);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 32);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);
		
		cv = new ContentValues();
		cv.put(AREA_ID, 33);
		cv.put(AREA_NAME, "RiverCentre Ramp");
		cv.put(ADDRESS_LINE, "150 West Kellogg Boulevard");
		cv.put(CAPACITY, 1500);
		cv.put(AMOUNT, 10);
		cv.put(ZIPCODE_ID, 55102);
		cv.put(AREA_TYPE, AreaType.LargeRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 341-8000");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 33);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 33);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);
		
		cv = new ContentValues();
		cv.put(AREA_ID, 34);
		cv.put(AREA_NAME, "Kellogg Municipal Ramp");
		cv.put(ADDRESS_LINE, "129 Kellogg Boulevard West");
		cv.put(CAPACITY,1500);
		cv.put(AMOUNT, 10);
		cv.put(ZIPCODE_ID, 55102);
		cv.put(AREA_TYPE, AreaType.LargeRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 341-8000");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 34);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 34);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);


		cv = new ContentValues();
		cv.put(AREA_ID, 35);
		cv.put(AREA_NAME, "Lawson Ramp");
		cv.put(ADDRESS_LINE, "379 Saint Peter St");
		cv.put(CAPACITY,500);
		cv.put(AMOUNT, 5);
		cv.put(ZIPCODE_ID, 55102);
		cv.put(AREA_TYPE, AreaType.SmallRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 222-7371");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 35);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 35);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);
		
		
		cv = new ContentValues();
		cv.put(AREA_ID, 36);
		cv.put(AREA_NAME, "Sibley Square at Mears");
		cv.put(ADDRESS_LINE, "221 SE 5th S");
		cv.put(CAPACITY,500);
		cv.put(AMOUNT, 4);
		cv.put(ZIPCODE_ID, 55101);
		cv.put(AREA_TYPE, AreaType.SmallRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 293-1847");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 36);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 36);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);
		
		
		
		cv = new ContentValues();
		cv.put(AREA_ID, 37);
		cv.put(AREA_NAME, "Regions Hospital");
		cv.put(ADDRESS_LINE, "640 Jackson St");
		cv.put(CAPACITY,1500);
		cv.put(AMOUNT, 4);
		cv.put(ZIPCODE_ID, 55101);
		cv.put(AREA_TYPE, AreaType.LargeRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(612) 254-3967");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 37);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 37);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);


		
		cv = new ContentValues();
		cv.put(AREA_ID, 38);
		cv.put(AREA_NAME, "Fox Lot");
		cv.put(ADDRESS_LINE, "137 S Robert St");
		cv.put(CAPACITY,800);
		cv.put(AMOUNT, 1.5);
		cv.put(ZIPCODE_ID, 55107);
		cv.put(AREA_TYPE, AreaType.MediumRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(763) 577-0975");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 38);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 38);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);
		
		
		cv = new ContentValues();
		cv.put(AREA_ID, 39);
		cv.put(AREA_NAME, "Diamond Products Lot");
		cv.put(ADDRESS_LINE, "310 5th St E");
		cv.put(CAPACITY,200);
		cv.put(AMOUNT, 2.5);
		cv.put(ZIPCODE_ID, 55101);
		cv.put(AREA_TYPE, AreaType.Lot.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(651) 292-2900");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 39);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 39);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);


		cv = new ContentValues();
		cv.put(AREA_ID, 40);
		cv.put(AREA_NAME, "Cray Plaza Ramp");
		cv.put(ADDRESS_LINE, "175 E 5th St");
		cv.put(CAPACITY,600);
		cv.put(AMOUNT, 2.5);
		cv.put(ZIPCODE_ID, 55101);
		cv.put(AREA_TYPE, AreaType.MediumRamp.toString());
		cv.put(PAYMENT_METHOD, PaymentMethodType.CashOrCreditCard.toString());
		cv.put(PHONE_NUMBER, "(651) 297-6733");
		db.insert(PARKING_AREA_TABLE, AREA_ID, cv);

		cv = new ContentValues();
		cv.put(AVAILABILITY_ID, 40);
		cv.put(AVAILABLE_SPOTS, 50);

		cv.put(AREA_ID, 40);
		db.insert(AVAILABILITY_TABLE, AVAILABILITY_ID, cv);





	}





}
